package bishi.meituan;

import java.util.*;

/**
 * @Classname Solution
 * @Description TODO
 * @Date 2021/9/11 19:30
 * @Created by ASUS
 */
/*
public static void main(String[] args) {
        char[][] board = new char[][]{
                {'X', 'X', 'X', 'X'},
                {'X', 'O', 'O', 'X'},
                {'X', 'X', 'O', 'X'},
                {'O', 'O', 'O', 'X'}
        };
        solve(board);
        for (char[] chars : board) {
            System.out.println(chars);
        }
    }
 */
public class Solution {
    static int[][] d = new int[][]{{0, -1}, {0, 1}, {-1, 0}, {1, 0}};
    static boolean[][] visited;
    static List<int[]> target = new ArrayList<>();

    public static void solve(char[][] board) {
        visited = new boolean[board.length][board[0].length];
        for (int i = 0; i < board.length; i++) {
            for (int j = 0; j < board[0].length; j++) {
                if (i == 0 || i == board.length - 1) {
                    if (!visited[i][j]) {
                        mark(board, i, j);
                    }
                } else {
                    if (j == 0 || j == board[0].length - 1) {
                        if (!visited[i][j]) mark(board, i, j);
                    }
                }
            }
        }
        for (int i = 0; i < board.length; i++) {
            for (int j = 0; j < board[0].length; j++) {
                board[i][j] = 'X';
            }
        }
        for (int[] ints : target) {
            board[ints[0]][ints[1]] = 'O';
        }
    }

    public static void mark(char[][] board, int x, int y) {
        if (visited[x][y]) return;
        visited[x][y] = true;
        if (board[x][y] == 'O') target.add(new int[]{x, y});
        else return;
        for (int[] dirs : d) {
            int dx = x + dirs[0];
            int dy = y + dirs[1];
            if (dx < 0 || dx >= board.length) continue;
            if (dy < 0 || dy >= board[0].length) continue;
            mark(board, dx, dy);
        }
    }

    static String sol(String str) {
        char[] chars = str.toCharArray();
        int left = 0, right = chars.length - 1;
        Set<Character> set = new HashSet<>(Arrays.asList('a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U'));
        while (left < right) {
            if (set.contains(chars[left])) left++;
            if (set.contains(chars[right])) right--;
            if (!set.contains(chars[left]) && !set.contains(chars[right])) {
                char t = chars[left];
                chars[left] = chars[right];
                chars[right] = t;
                left++;
                right--;
            }
        }
        return String.valueOf(chars);
    }

    public static void main(String[] args) {
        int cnt=0;
        for (int i = 1560; i <= 1611; i++) {
            if (i % 4 == 0 && i % 400 != 0) cnt++;
        }
        System.out.println(cnt);
    }
}
